<?php
/*
 * @Author: 乔
 * @Date: 2021-10-09 14:13:31
 * @LastEditTime: 2021-11-08 16:02:51
 * @LastEditors: 乔
 * @FilePath: \tp30\app\admin\controller\User.php
 */

namespace app\admin\controller;

use app\BaseController;
use think\facade\View;

class User extends BaseController
{
    public function user()
    {
        $list = \app\admin\model\Admin::field('a.id,a.name,a.headimg,g.title')
            ->alias('a')
            ->join('auth_group g', 'a.author=g.id', 'LEFT')
            ->paginate([
                'list_rows' => 5,
            ]);
        $data = $list->toArray()['data'];
        $title = ['ID', '用户名', '头像', '权限'];
        $res = Message::export($data, $title);
        View::assign('list', $list);
        return view();
    }
    public function userAdd()
    {
        return view();
    }
    public function userEdit()
    {
        return view();
    }
}
